package com.dashboard.cloud.datasource.controller;

import com.dashboard.cloud.common.module.APIResult;
import com.dashboard.cloud.datasource.module.EncryptReq;
import com.dashboard.cloud.datasource.service.DruidEncryptService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: spring-cloud-dashboard
 * @Package: com.dashboard.cloud.datasource.controller
 * @ClassName: DuridEncryptController
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/8 17:13
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@RestController
@RequestMapping("/druid")
public class DruidEncryptController {
    @Resource
    private DruidEncryptService druidEncryptService;

    @PostMapping("/encrypt")
    public APIResult<Map<String, Object>> testSentinel(@RequestBody EncryptReq encryptReq) {
        Map<String, Object> stringObjectMap = druidEncryptService.encryptPlainText(encryptReq);
        return APIResult.success(stringObjectMap);
    }
}